package com.pattern.factory;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class CoffeeStore {

    private CoffeeFactory factory;

    public static void main(String[] args) {

        CoffeeFactory factory  = new AmericanCoffeeFactory();
        CoffeeStore coffeeStore = new CoffeeStore(factory);
        Coffee coffee = coffeeStore.orderCoffee();
        System.out.println("coffee = " + coffee);
    }

    public Coffee orderCoffee() {
        Coffee coffee= this.factory.createCoffee();
        coffee.addMilk();
        return coffee;

    }

}
